﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace ZOVNP.Model.Abstracts
{
    /// <summary> Интерфейс сервиса вывода сообщений </summary>
    [Description("Интерфейс сервиса вывода сообщений")]
    public interface IMessageService
    {
        /// <summary> Вывести сообщение о возникшем исключении </summary>
        /// <param name="exception"> исключение </param>
        void ShowError(Exception exception);
        /// <summary> Вывести сообщение о возникшем исключении </summary>
        /// <param name="exception"> исключение </param>
        /// <param name="message"> дополнительное сообщение </param>
        void ShowError(Exception exception, string message);
        /// <summary> Вывести сообщение о возникшем исключении </summary>
        /// <param name="exception"> исключение </param>
        /// <param name="message"> дополнительное сообщение </param>
        /// <remarks> Метод выводит все внутренние исключения </remarks>
        void ShowAllErrors(Exception exception, string message);
        /// <summary> Вывести сообщение </summary>
        /// <param name="message"> текст сообщения </param>
        void ShowMessage(string message);
        /// <summary> Вывести вопрос </summary>
        /// <param name="question"> строка вопроса </param>
        /// <returns> true при положительном ответе пользователя, в противном случае - false </returns>
        bool AskQuestion(string question);
        /// <summary> Вывести сообщение (вопрос, уведомление) </summary>
        /// <param name="message"> текст сообщения </param>
        /// <param name="buttons"> одно или несколько значений из MessageServiceMessageBoxButtons </param>
        /// <returns> одно из значений перечисления MessageServiceDialogResult </returns>
        MessageServiceDialogResult ShowNotification(string message, MessageServiceMessageBoxButtons buttons);
    }
    /// <summary> Варианты ответов </summary>
    public enum MessageServiceDialogResult
    {
        None = 0,
        Ok = 1,
        Cancel = 2,
        Abort = 3,
        Retry = 4,
        Ignore = 5,
        Yes = 6,
        No = 7
    }
    /// <summary> Допустимые комбинации кнопок сервиса сообщений </summary>
    public enum MessageServiceMessageBoxButtons
    {
        OK = 0,
        OKCancel = 1,
        AbortRetryIgnore = 2,
        YesNoCancel = 3,
        YesNo = 4,
        RetryCancel = 5
    }
    /// <summary> Иконки сервиса сообщений </summary>
    public enum MessageServiceMessageBoxIcon
    {
        /// <summary> The message box contain no symbols. </summary>
        None = 0,
        /// <summary> The message box contains a symbol consisting of white X in a circle with a red background. </summary>
        Error = 16,
        Hand = 16,
        Stop = 16,
        /// <summary>
        ///     The message box contains a symbol consisting of a question mark in a circle.
        ///     The question-mark message icon is no longer recommended because it does not
        ///     clearly represent a specific type of message and because the phrasing of
        ///     a message as a question could apply to any message type. In addition, users
        ///     can confuse the message symbol question mark with Help information. Therefore,
        ///     do not use this question mark message symbol in your message boxes. The system
        ///     continues to support its inclusion only for backward compatibility.
        ///</summary>
        Question = 32,
        /// <summary> The message box contains a symbol consisting of an exclamation point in a triangle with a yellow background. </summary>
        Exclamation = 48,
        /// <summary> The message box contains a symbol consisting of an exclamation point in a triangle with a yellow background. </summary>
        Warning = 48,
        /// <summary> The message box contains a symbol consisting of a lowercase letter i in a circle. </summary>
        Information = 64,
        /// <summary> The message box contains a symbol consisting of a lowercase letter i in a circle. </summary>
        Asterisk = 64,
    }
    public enum MessageServiceMessageBoxDefaultButton
    {
        // Summary: The first button on the message box is the default button.
        Button1 = 0,
        // Summary: The second button on the message box is the default button.
        Button2 = 256,
        // Summary: The third button on the message box is the default button.
        Button3 = 512,
    }
}
